<?php
namespace Home\Model;

use Think\Model\RelationModel;

class UserModel extends RelationModel
{

    protected $_link = array(

        //关联模型
        //一对一
        /*'Card' => array(
            'mapping_type' => self::HAS_ONE,
            'foreign_key' => 'uid',
            //'mapping_name' => 'abc',
            //'class_name' => 'Card',
            'mapping_fields' => 'code',
            'as_fields' => 'code',
            //'condition' => 'id=1',
        ),*/

        //一对多
        /*'Content' => array(
            'mapping_type' => self::HAS_MANY,
            'foreign_key' => 'uid',
            'class_name' => 'Content',
            'mapping_name' => 'contents',
            'mapping_fields' => 'content',
            'mapping_limit' => '0,2',
            'mapping_order' => 'id DESC',
        ),*/

        //多对多
        /*'Role' => array(
            'mapping_type' => self::MANY_TO_MANY,
            'relation_table' => 'think_group',
            'foreign_key' => 'uid',
            'relation_foreign_key' => 'gid',
        ),*/
    );


}

